﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin2.master" AutoEventWireup="true" CodeFile="QuanLyThamSo.aspx.cs" Inherits="Admin_QuanLyThamSo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style2
        {
            width: 105px;
        }
        .style5
        {
            width: 124px;
        }
        .style6
        {
            width: 380px;
        }
        .style7
        {
            width: 166px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
            <fieldset>
                <legend style="text-align: center; font: 18px bold; color: #000000">Danh Sách Bảng Tham
                    Số</legend>
                <div align="center">
                    <asp:GridView ID="gvSanPham" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" BorderColor="#D2D2D2" BorderStyle="Solid" BorderWidth="1px"
                        CellPadding="2" CellSpacing="3" DataKeyNames="MaThamSo" OnPageIndexChanging="gvSanPham_PageIndexChanging"
                        OnRowCancelingEdit="gvSanPham_RowCancelingEdit" OnRowDataBound="gvSanPham_RowDataBound"
                        OnRowDeleting="gvSanPham_RowDeleting" OnRowEditing="gvSanPham_RowEditing" 
                        OnRowUpdating="gvSanPham_RowUpdating" PageSize="5" Width="900px" 
                        onrowcommand="gvSanPham_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="MaThamSo" HeaderText="Mã TS" ReadOnly="True" SortExpression="MaThamSo" />
                            <asp:BoundField DataField="GiaTriGiam" HeaderText="Giá Trị" 
                                SortExpression="GiaTriGiam" />
                            <asp:BoundField DataField="SoLanMua" HeaderText="Số Lần" 
                                SortExpression="SoLanMua" />
                            <asp:BoundField DataField="NgayBD" HeaderText="Ngày Bắt Đầu" 
                                SortExpression="NgayBD" DataFormatString="{0:dd/MM/yyyy}" />
                            <asp:BoundField DataField="NgayKT" HeaderText="Ngày Kết Thúc" 
                                SortExpression="NgayKT" DataFormatString="{0:dd/MM/yyyy}" />
                            <asp:BoundField DataField="YNghia" HeaderText="Ý Nghĩa" SortExpression="YNghia" />
                            <asp:TemplateField HeaderText="Chọn">
                                <ItemTemplate>
                                <div style="vertical-align:middle;margin-left:10px;">
                                <asp:LinkButton ID="LinkButton2" CssClass="btnicon2" runat="server" 
                                        CommandName="Delete" 
                                        OnClientClick="return confirm('Bạn có chắc chắn muốn xóa tham số này không?');" 
                                        ToolTip="Xóa tham số"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Sửa tham số" 
                                        CommandArgument='<%# Eval("MaThamSo") %>'></asp:LinkButton>
                                    
                                    <!--<asp:LinkButton ID="LinkButton3" CssClass="btnicon3" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" CssClass="btnicon4" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton5" CssClass="btnicon5" runat="server"></asp:LinkButton>-->
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                            </asp:TemplateField>
                            
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" BorderWidth="1px"
                            Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:GridView>
                    <br />
                    <asp:Label ID="lbLoiGiaTri" runat="server" ForeColor="Red"></asp:Label>
                    <asp:HiddenField ID="hdNgayKT" runat="server" />
                    <asp:HiddenField ID="hdNgayBD" runat="server" />
                    <br />
                    <asp:Button ID="btThemMoi" runat="server" Height="25px" OnClick="btThemMoi_Click"
                        Text="Thêm Mới" Width="100px" />
                </div>
            </fieldset>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <div style="margin-left: 10px">
                <table border="0" cellpadding="0" cellspacing="0" id="id-form">
                    <tr>
                        <td class="style2" style="font-size: 14px">
                            Mã Tham Số :&nbsp;&nbsp;
                        </td>
                        <td class="style6">
                            <asp:TextBox ID="txtMaThamSo" runat="server" CssClass="inp-form"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtMaThamSo"
                                ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                        <td class="style7">
                    &nbsp;</td>
                    </tr>
                    
                    <tr>
                        <td class="style2" style="font-size: 14px">
                            Giá Trị Giảm :&nbsp;&nbsp;
                        </td>
                        <td class="style6">
                            <asp:TextBox ID="txtGiaTri" runat="server" CssClass="inp-form"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ControlToValidate="txtGiaTri" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtGiaTri"
                                ErrorMessage="Giá Trị Phải Là Số" ForeColor="Red" 
                                ValidationExpression="\d+$"></asp:RegularExpressionValidator>
                        </td>
                        <td class="style7">
                    &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style2" style="font-size: 14px">
                            Số Lần Mua :&nbsp;&nbsp;
                        </td>
                        <td class="style6">
                            <asp:TextBox ID="txttenqc" runat="server" CssClass="inp-form"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txttenqc"
                                ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator><asp:RegularExpressionValidator
                                    ID="RegularExpressionValidator2" runat="server" 
                                ErrorMessage="Số Lần Phải Là Số" ControlToValidate="txttenqc" ForeColor="Red" 
                                ValidationExpression="\d+$"></asp:RegularExpressionValidator>
                        </td>
                        <td class="style7">
                    &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style2" style="font-size: 14px">
                            Ngày Bắt Đầu:&nbsp;&nbsp;
                        </td>
                        <td class="noheight" style="width: 380px">
                          <table border="0" cellpadding="0" cellspacing="0">
			<tr  valign="top">
				<td>
				<form id="chooseDateForm" action="#">
				
				<asp:DropDownList ID="dlNgay" runat="server" CssClass="styledselect-day" 
                    Width="100px">
                </asp:DropDownList>
&nbsp;</td>
				<td>
					<asp:DropDownList ID="dlThang" runat="server" 
                        CssClass="styledselect-month" Width="100px" style="width: 104px;">
                    </asp:DropDownList>
&nbsp;</td>
				<td>
					
					</form>
				    <asp:DropDownList ID="dlNam" runat="server" 
                        CssClass="styledselect-year" Width="100px">
                    </asp:DropDownList>
				</td>
				<td>
                    &nbsp;</td>
			</tr>
			</table>  
                            
                                
                        </td>
                        <td align="center" style="padding: 2px" class="style7">
            <br />
            <asp:Label ID="lbNgay" runat="server" ForeColor="Red"></asp:Label>
            </td>
                    </tr>
                    <tr>
                        <td class="style2" style="font-size: 14px">
                            Ngày Kết Thúc:&nbsp;&nbsp;
                        </td>
                        <td class="noheight" style="width: 380px">
                          <table border="0" cellpadding="0" cellspacing="0">
			<tr  valign="top">
				<td>
				
				
				<asp:DropDownList ID="dlNgayKT" runat="server" CssClass="styledselect-day" 
                    Width="100px">
                </asp:DropDownList>
&nbsp;</td>
				<td>
					<asp:DropDownList ID="dlThangKT" runat="server" 
                        CssClass="styledselect-month" Width="100px" style="width: 104px;">
                    </asp:DropDownList>
&nbsp;</td>
				<td>
					
					
				    <asp:DropDownList ID="dlNamKT" runat="server" 
                        CssClass="styledselect-year" Width="100px">
                    </asp:DropDownList>
				</td>
				<td>
                    &nbsp;</td>
			</tr>
			</table>  
                            
                                
                        </td>
                        <td align="center" style="padding: 2px" class="style7">
            <br />
            <asp:Label ID="lbNgayKT" runat="server" ForeColor="Red"></asp:Label>
            </td>
                    </tr>
                    <tr>
                        <td class="style2" style="font-size: 14px">
                            Ý Nghĩa :&nbsp;&nbsp;
                        </td>
                        <td class="style6">
                            <asp:TextBox ID="txtYNghia" runat="server" CssClass="inp-form"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtYNghia"
                                ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                        <td class="style7">
                    &nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="3" style="font-size: 14px" align="center">
                            <asp:Button ID="btthem" runat="server" Text="Thêm" OnClick="btthem_Click" Height="25px"
                                Width="50px" />
                            &nbsp;
                            <asp:Button ID="btCapNhat" runat="server" Text="Cập Nhật" Height="25px" 
                                onclick="btCapNhat_Click" Width="90px" />
                        </td>
                    </tr>
                </table>
            </div>
        </asp:View>
    </asp:MultiView>
</asp:Content>

